#include <stdio.h>
#include <string.h>
int main()
{
    char in[100] = "I like C++!";
    char out[100] = "";
    int i = 0, j = 0, k = 0;
    int length = strlen(in);
    char temp;
    gets(in);
    for (i = 0; i < length; i++)
    {
        if (in[i] == ',' || in[i] == '.' || in[i] == '?' || in[i] == '!' || in[i] == ' ')
        {
            for (k = 0; k < j/2; k++)
            {
                temp = out[k];
                out[k] = out[j - k - 1];
                out[j - k - 1] = temp;
            }

            j = 0;
            printf("%s%c", out, in[i]);
            memset(out, 0, sizeof(out));
        }
        else
        {
            out[j] = in[i];
            j++;
        }
    }
    return 0;
}
